package com.ljh.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author ：刘剑鸿
 * @date ：Created in 2021/10/26 8:04
 * @description：处理器   一定要加到IOC容器中
 * @modified By：
 * @version: $
 */
@Slf4j
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
        log.info("start insert fill>>>>>");
        this.setFieldValByName("resevationtime",new Date(),metaObject);
        this.setFieldValByName("outTime",new Date(),metaObject);
        this.setFieldValByName("billtime",new Date(),metaObject);
        this.setFieldValByName("footbilltime",new Date(),metaObject);
        this.setFieldValByName("tomember",new Date(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
